'''
Módulo base da estrutura dos integradores de SPH 

@author: hanniel

'''

class Integrator:
    '''
    Integrador Euler implícito: r(t+dt)=r(t)+dt*u(t+dt)
    '''

    def __init__(self):
    
        self.solve_list=[]
    
    def add_eq(self, equation):
        
        allowed=['momentum','mass','temperature','pressure','viscosity','stress']
        
        if equation in allowed:
        
            self.solve_list.append(equation)
            
        else:
            
            print "\n *Bad equation request: %s not in allowed options: %s" % (equation,allowed)      
        
    
    def Implicit_Euler(self, particle, dt):
        
        if 'momentum' in self.solve_list:
        
            particle.x=particle.x+dt*particle.vx
            particle.y=particle.x+dt*particle.vy
            '''particle.z=particle.z+dt*particle.vz'''
            
        if 'mass' in self.solve_list:
            
            pass
        
        if 'temperature' in self.solve_list:
            
            pass
        
        if 'pressure' in self.solve_list:
            
            pass
        
        if 'viscosity' in self.solve_list:
            
            pass
        
        if 'stress' in self.solve_list:
            
            pass

    
    def Leapfrog(self, particle, dt):
        
        if 'momentum' in self.solve_list:
        
            particle.x=particle.x+dt*particle.vx
            particle.y=particle.x+dt*particle.vy
            '''particle.z=particle.z+dt*particle.vz'''
            
        if 'mass' in self.solve_list:
            
            pass
        
        if 'temperature' in self.solve_list:
            
            pass
        
        if 'pressure' in self.solve_list:
            
            pass
        
        if 'viscosity' in self.solve_list:
            
            pass
        
        if 'stress' in self.solve_list:
            
            pass